/*
 * cria a instância de uma classe p/ ser persistida
 */

package clinicapoo.factory;

import java.util.HashMap;
import java.util.Map;

/** *
 * @author fmontezuma
 * christiano - 
 */
public class SingletonFactory
{
	private static Map<Class, Object> instances = new HashMap<Class, Object>();

	public static Object getInstance(Class c)
	{
		if (!instances.containsKey(c))
		{
			try
			{
				instances.put(c, c.newInstance());
			}
			catch (Exception e) {	}
		}
		return instances.get(c);
	}
}
